package com.express.service.impl;

import com.express.entity.ExOrder;
import com.express.mapper.ExCarMapper;
import com.express.mapper.ExOrderMapper;
import com.express.service.ExOrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author express
 * @since 2022-01-23
 */
@Service
public class ExOrderServiceImpl extends ServiceImpl<ExOrderMapper, ExOrder> implements ExOrderService {

    @Autowired
  private ExCarMapper exCarMapper;
    @Autowired
    private ExOrderMapper exOrderMapper;
    @Override
    public List<ExOrder> findAll() {
        List<ExOrder> list=exOrderMapper.findAll();
        for(ExOrder a:list){
            a.setExCar(exCarMapper.selectById(a.getCarId()));
        }
        return list;
    }
}
